using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;
using System.ComponentModel;
using Xeml.Document;
using Xeml.Sampling;

namespace Xeml.Document.Contracts
{
    public interface IDocument //: IXemlComponent
    {
      
        /// <summary>
        /// The name of the experiment.
        /// </summary>
        string Name
        {
            get;
            set;
        }

        /// <summary>
        /// A global unique identifiere for the experiment.
        /// </summary>
        Guid Id
        {
            get;
        }

        /// <summary>
        /// The start date of the experiment.
        /// </summary>
        DateTime StartDate
        {
            get;
            set;
        }

        /// <summary>
        /// The observed time span for the experiment.
        /// </summary>
        TimeSpan ObservationTime
        {
            get;
            set;
        }

        /// <summary>
        /// Get's the xeml code.
        /// </summary>
        string Xeml
        {
            get;

        }

        
        /// <summary>
        /// All document ressources.
        /// </summary>
        DocumentResources DocumentResources
        {
            get;
        }

      
        /// <summary>
        /// Contains inforamtion about story, parameters and observations.
        /// </summary>
        Xeml.Document.StoryBoard StoryBoard
        {
            get;
            set;
        }

        /// <summary>
        /// Data sids between observer points an sample id's of multiple data sources.
        /// </summary>
        Xeml.Document.ProviderDataMappings ProviderDataMappings
        {
            get;
        }


        Xeml.Document.ExperimentHeader ExperimentHeader
        {
            get;
            set;
        }


        /// <summary>
        /// Creates as new id for this document
        /// </summary>
        void NewId();



        /// <summary>
        /// Loads a Xeml document.
        /// </summary>
        /// <param name="xemlCode">xml content of the Xeml document.</param>
        void Load(string xemlCode);

        /// <param name="xemlCode">Path to the Xeml document.</param>
        void Save(string path);

        /// <summary>
        /// Generates the xeml code new.
        /// </summary>
        void RefreshXeml();

        /// <summary>
        /// Loads a xeml document from a file path.
        /// </summary>
        /// <param name="path"></param>
        void LoadFile(string path);

        /// <summary>
        /// Validates the current xeml code against the schema.
        /// </summary>
        void DoXmlValidation();

        /// <summary>
        /// Validates a given xeml code against the schema.
        /// </summary>
        void DoXmlValidation(string xemlCode);

        /// <summary>
        /// A event handle which indicates that the xeml code is changed.
        /// </summary>
        event EventHandler Changed;

        /// <summary>
        /// A event handle which indicates that the document is loaded.
        /// </summary>
        event EventHandler Loaded;

        event System.EventHandler<Xeml.Document.ValidationMessage> Validation;

    }
}
